import { useState } from 'react'
import { Input,Button} from 'antd'


export default function AddTask({ onAddTask }:any) {
    const [text, setText] = useState('')
    return (
        <>
            <Input
                placeholder="添加任务"
                value={text}
                onChange={(e) => setText(e.target.value)}
            />
            <Button
                onClick={() => {
                    setText('')
                    onAddTask(text)
                }}>
                添加
            </Button>
        </>
    )
}
